package com.geotmt.billingcenter.modules.rules.mapper;

import com.geotmt.billingcenter.common.entry.StairRule;
import com.geotmt.billingcenter.modules.rules.mapper.provider.RulesProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Description 计费规则类
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/3/25 17:28
 * @Version     v1
 **/
@Mapper
public interface RulesMapper {

    /**
     * 添加阶梯计费规则
     * @param stairRule
     */
    @InsertProvider(type = RulesProvider.class, method = "addStair")
    @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
    void addStair(StairRule stairRule);


    /**
     * getListByRid
     * @param rId
     * @param label
     * @return
     */
    @SelectProvider(type = RulesProvider.class, method = "stairListGetByRid")
    List<StairRule> stairListGetByRid(@Param(value = "rId") Integer rId,
                                      @Param(value = "label") Integer label);
}
